package org.jhotdraw.app.action.edit;

import java.awt.event.ActionEvent;

import javax.swing.JOptionPane;

import org.jhotdraw.app.Application;
import org.jhotdraw.app.View;
import org.jhotdraw.app.action.AbstractApplicationAction;
import org.jhotdraw.app.action.AbstractViewAction;
import org.jhotdraw.draw.Drawing;
import org.jhotdraw.util.ResourceBundleUtil;

import stateDiagram.ErrorChecker;
import stateDiagram.StateDiagramView;

public class ErrorCheckerAction extends AbstractViewAction
{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	/**
	 * 
	 */
	
	View view;
	Application app;
	ErrorChecker checker;
	public final static String ID = "edit.errorChecker";

	public ErrorCheckerAction(Application app, View view) {
		super(app, view);
		this.view = view;
		this.app = app;
		ResourceBundleUtil labels = ResourceBundleUtil.getBundle("org.jhotdraw.app.Labels");
        labels.configureAction(this, ID);
	}

	@Override
	public void actionPerformed(ActionEvent e) {
		checker = new ErrorChecker();
		Drawing drawing = ((StateDiagramView) this.getActiveView()).getEditor().getActiveView().getDrawing();
		checker.checkForErrors(drawing);
	}


}
